package com.kafka.service.strategy;

import org.apache.commons.lang3.StringUtils;

import java.util.HashMap;
import java.util.Map;


/**
 * @descriptions: 工厂设计模式
 * @author: yunqiang
 * @date: 2022/1/5 15:18
 */
public class FactorStrategy {
    private static Map<String, Handel> strategyMap = new HashMap<>();

    public static Handel getInvokeStrategy(String str){
        return strategyMap.get(str);
    }

    public static void register(String str,Handel handler){
        if(StringUtils.isEmpty(str) || str == null){
            return;
        }
        strategyMap.put(str,handler);
    }


}
